Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(sdk/go): Refactor the Redis Go SDK to be more idiomatic #1844

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

adamreese
Copy link
Member

  • Introduces a client struct responsible for handling the connection
  • Refactor the Execute() arguments

@adamreese adamreese added this to the 2.0 milestone Oct 3, 2023
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder to track or line up updates to examples/docs in https://github.com/fermyon/developer on/around the 2.0 release.

Not sure if we have opinionated Go programmers/users that might be a better sign-off on this PR, but the changes look reasonable to me!

sdk/go/redis/redis.go Outdated Show resolved Hide resolved
sdk/go/redis/redis.go Outdated Show resolved Hide resolved
@adamreese adamreese force-pushed the feat/sdk-go-redis-v2 branch 2 times, most recently from bb5f39c to 9b57763 Compare October 26, 2023 16:03
// should work with any Redis command.
//
// Arguments must be string, []byte, int, int64, or int32.
func (c *Client) Execute(command string, arguments ...any) ([]*Result, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love some opinions on using an any rather than a typed argument. I don't know how I feel about it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its pretty standard for better or worse 🤷

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably have this return an error if an unsupported type is passed in though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an error

@adamreese adamreese force-pushed the feat/sdk-go-redis-v2 branch 3 times, most recently from d2322cb to 39b0699 Compare October 26, 2023 21:49
- Introduces a client struct responsible for handling the connection
- Refactor the `Execute()` arguments

Signed-off-by: Adam Reese <[email protected]>
@adamreese adamreese merged commit ed4e13f into fermyon:main Oct 27, 2023
9 checks passed
@adamreese adamreese deleted the feat/sdk-go-redis-v2 branch October 27, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants